package edu.arizona.arid.akshen;

import java.io.IOException;
import java.io.InputStream;
import java.io.OutputStream;
import java.net.Socket;

/**
 * For demonstration
 * 
 * @author Sumin Byeon
 * 
 */
public final class Client {

	private Socket socket;
	//private DataInputStream din;
	//private DataOutputStream dout;
	private InputStream in;
	private OutputStream out;
	//private PrintStream out;
	
//	private String sessionId;

	public Client(Socket socket) throws IOException {
		this.socket = socket;
		//this.din = new DataInputStream(socket.getInputStream());
		//this.dout = new DataOutputStream(socket.getOutputStream());
		this.in = socket.getInputStream();
		this.out = socket.getOutputStream();
		
		System.out.println(this.socket);
		//System.out.println(this.din);
		//System.out.println(this.dout);
		
		//dout.writeUTF("Connected to server");
	}

	public void setSocket(Socket socket) {
		this.socket = socket;
	}

	public Socket getSocket() {
		return socket;
	}
	
	public InputStream getInputStream() {
		return in;
	}
	
	public OutputStream getOutputStream() {
		return out;
	}

//	public void setDataInputStream(DataInputStream din) {
//		this.din = din;
//	}
//
//	public DataInputStream getDataInputStream() {
//		return din;
//	}
//
//	public void setDataOutputStream(DataOutputStream dout) {
//		this.dout = dout;
//	}
//
//	public DataOutputStream getDataOutputStream() {
//		return dout;
//	}

//	public void setOutStream(PrintStream out) {
//		this.out = out;
//	}
//
//	public PrintStream getOutStream() {
//		return out;
//	}
	
	public void disconnect() throws IOException {
		in.close();
		out.close();
		socket.close();
	}
}
